package com.tml.service.impl;

import com.tml.dao.ISmbmsUserDao;
import com.tml.dao.impl.SmbmsUserDao;
import com.tml.entry.SmbmsUser;
import com.tml.service.ILoginService;

public class LoginService implements ILoginService {

    public boolean login(String userName,String userPwd){
        try {
            //SmbmsUserDao smbmsUserDao =new SmbmsUserDao();
            ISmbmsUserDao smbmsUserDao =new SmbmsUserDao();
            SmbmsUser smbmsUser = smbmsUserDao.getSmbmsUserByUserCode(userName);

            if(smbmsUser!=null){
                if(smbmsUser.getUserPassword().equals(userPwd)){
                   return true;
                }else{
                   return false;
                }
            }else{
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return false;

    }
}
